//
//  VPScanQrCodeView.h
//  qrCodeDemo
//
//  Created by vernepung on 15/11/16.
//  Copyright © 2015年 vernepung. All rights reserved.
//

#import <UIKit/UIKit.h>

UIKIT_EXTERN CGFloat const VPScanQrCodeViewDefaultWidth;

typedef NS_ENUM(NSInteger,VPQrCodeError) {
    VPQrCodeErrorCantOpenCapture = 0,
};
@protocol VPScanQrCodeViewDelegate;
@interface VPScanQrCodeView : UIView

@property (assign, nonatomic) CGFloat maxZoom;
@property (weak,nonatomic) id<VPScanQrCodeViewDelegate> delegate;

- (instancetype)initWithFrame:(CGRect)frame maskViewWidth:(CGFloat)width maskBorderColor:(UIColor *)color tintColor:(UIColor *)tintColor andNavHeight:(CGFloat)heihgt;
- (void)startScanQrCode;
@end


@protocol VPScanQrCodeViewDelegate <NSObject>
/**
 扫描到二维码
 */
- (void)vpScanQrCodeCompletedWithResult:(NSString *)result;
@optional

/**
 无法使用相机（跳转设置）
 */
- (void)vpScanQrCodeWithError:(VPQrCodeError *)error;

/**
 相机已经启动，执行startScanQrCode进行动画展示
 */
- (void)vpCaptureRunningCompleted;
@end
